package io.renren.modules.merchant.service.impl;

import com.baomidou.mybatisplus.core.conditions.query.QueryWrapper;
import com.baomidou.mybatisplus.extension.service.impl.ServiceImpl;

import io.renren.modules.dishes.entity.MerchantEntity;
import io.renren.modules.merchant.dao.MerchantDao;
import io.renren.modules.merchant.service.MerchantService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

@Service
public class MerchantServiceImpl extends ServiceImpl<MerchantDao, MerchantEntity> implements MerchantService {

    @Autowired
    private MerchantDao merchantDao;


    @Override
    public MerchantEntity getMerchantByUserId(Long id) {
        QueryWrapper<MerchantEntity> wrapper=new QueryWrapper<MerchantEntity>()
                .eq("user_id",id);
        MerchantEntity merchantEntity = merchantDao.selectOne(wrapper);
        return merchantEntity;
    }
}
